<?php 
session_start();
 
include_once("../c/config.php");
$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}

$jId=4;
$openid='oe2K2jizhbCXu_vRGRL3BoQRrkfU';
$_SESSION['openid']=$openid;


$query=$mysqli->query("select city from users where openid='".$openid."' limit 0, 1");
if($query->num_rows>0){
   $getCityInfo=$query->fetch_array();
   $city=$getCityInfo['city'];
   if('苏州' == $city){
       $mysqli->query("insert into city_log(openid,createtime) values('".$_SESSION['openid']."','".date("Y-m-d H:i:s")."')  ");
       $queryCityLog=$mysqli->query("select id from city_log where openid='".$_SESSION['openid']."' order by id desc limit 0, 1");
       $getCityId=$queryCityLog->fetch_array();
       $cityId=$getCityId['id'];
       
       if(4 == $cityId){
           $jId=1;
       }
       
       echo $cityId;
       
   }
   echo "<br />";
   echo $city;
   echo "<br />";
   echo $jId;
  
}
	 